
"""
Created on Tue Feb 19 14:55:43 2013

@author: aponteeduarddo@gmail.com
Copyright Eduardo Aponte 2013.
"""

from mex_binder import binder_py

eyelink_eye_available = binder_py('mx_eyelink_eye_available')
eyelink_eye_available.mx_c.headers = ['<eyelink.h>','"mex.h"']
eyelink_eye_available.bindo += []
eyelink_eye_available.mx_c.code = \
"""
INT16 _main( void )
{
    return eyelink_eye_available( ); ;
}

void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
    mwSize td[2] = {1,1};
    double *status;
    
    /* Verify input arguments. */
    if(nrhs != 0 ) {
        mexErrMsgTxt("Incorrect number of inputs.");
    } else if( nlhs > 1 ) {
        mexErrMsgTxt("Too many output arguments.");
    }
    
        
    plhs[0] = mxCreateNumericArray( 2, td, mxDOUBLE_CLASS, mxREAL);
    status = mxGetPr(plhs[0]);    
    *status = (double ) _main( ); 
    return;
}
"""

eyelink_eye_available.mx_c.mdoc = \
"""function [ ] = mx_eyelink_eye_available( )
%MX_EYELINK_EYE_AVAILABLE After calling eyelink_wait_for_block_start(), or 
% after at least one sample or eye event has been read, can be used to check %
% which eyes data is available for.
%
% Returns:
% One of these constants, defined in EYE_DATA.H: 0 if left eye data. 1 if right
% eye data. 2 if both left and right eye data. -1 if no eye data is available
%
"""
eyelink_eye_available.write_c()
eyelink_eye_available.write_m()
eyelink_eye_available.compile()
eyelink_eye_available.write_sh()

